package com.lanou.bookstore.user.service;

import com.lanou.bookstore.user.dao.RegisterDao;
import com.lanou.bookstore.user.domain.User;
import com.lanou.bookstore.util.JDBCUtil;

public class RegisterService {
    private RegisterDao dao=new RegisterDao();

    public boolean register(User user){
        JDBCUtil.begin();
        if (!dao.findByUsername(user.getUsername())){
            JDBCUtil.closeConn();
            return dao.register(user);
        }
        JDBCUtil.closeConn();
        return false;
    }




}
